Create text completion from a single prompt .
cURL
curl --request POST \ --url https://api.anyapi.ai/v1/completions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "<string>", "prompt": "<any>" }'
{ "id": "<string>", "object": "text_completion", "created": 123, "model": "<string>", "choices": [ { "text": "<string>", "index": 123, "logprobs": { "tokens": [ "<string>" ], "token_logprobs": [ 123 ], "top_logprobs": [ {} ], "text_offset": [ 123 ] }, "finish_reason": "stop" } ], "usage": { "completion_tokens": 123, "prompt_tokens": 123, "total_tokens": 123 } }
Bearer token authentication. Get your API key from the dashboard.
Successful response
The response is of type object.
object